// 操作系统平台
typedef enum os_platform {
    WINNT,
    LINUX,
    MACOS,
} os_platform_t;

// 播放器控制命令
typedef enum {
    PLAYER_CMD_NONE = 0,
    PLAYER_CMD_PAUSE = 1,
    PLAYER_CMD_RESUME = 2,
    PLAYER_CMD_STOP = 3,
} player_ctrl_cmd_t;

// 通用PCM播放器接口
typedef struct pcm_player {
    os_platform_t platform;  // 操作系统平台
    char *name;
    int (*check)();
    int (*init)(int channels, int samplerate, int bits_per_sample);
    int (*getParams)(int *channels, int *samplerate, int *bits_per_sample);
    int (*setVolume)(int db);
    int (*write)(void *pcm_data, int size);
    int (*ctrl)(player_ctrl_cmd_t cmd, void *arg);
    int (*deinit)(void);
} pcm_player_t;

int pcmPlayer_register(pcm_player_t *pcm_player);  // 安装PCM播放器


#define UI_HEIGHT_CTRL 3        // CTRL区域高度
#define UI_HEIGHT_LIST 0        // LIST区域高度,auto
#define UI_MIN_HEIGHT_LIST 6    // LIST区域最小高度
#define UI_HEIGHT_LOG  10       // LOG区域高度

#define UI_MIN_HEIGHT  (UI_HEIGHT_CTRL + UI_MIN_HEIGHT_LIST + UI_HEIGHT_LOG) // 最小屏幕高度
#define UI_MIN_WIDTH   40       // 最小屏幕宽度